<?php
include('fonctionSQL.php');

//Inclusion du header de la page
include 'header.php';
?>
<script type="text/javascript" src="JS/verifCreationUtil.js"></script>
</head>

<body>

    <header id="header">
        <hgroup>
            <h1 class="site_title"><a href="index.html">Projet BIMSITE</a></h1>
            <h2 class="section_title">Edition de parcours de chasse au trésor</h2><div class="btn_view_site">
                <!--                            <a href="http://www.medialoot.com">View Site</a>-->
            </div>
        </hgroup>
    </header> <!-- end of header bar -->

    <section id="secondary_bar">
        <div class="user">
            <p> 
                <?php
                session_start();

// On teste si la variable de session existe et contient une valeur
                if (empty($_SESSION['username'])) {
// Si inexistante ou nulle, on redirige vers le formulaire de login
                    header('Location: identification.php');
                    exit();
                }
                echo "" . $_SESSION['username'] . "   (";
                echo "<a id='deconnexion' href='logout.php'>Deconnexion</a>)"
                ?></p>
            <!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
        </div>
        <div class="breadcrumbs_container">
            <article class="breadcrumbs"><a href="#">Ajout d'utilisateur</a></article>
        </div>
    </section><!-- end of secondary bar -->

    <aside id="sidebar" class="column">
        <form class="quick_search">
            <input type="text" value="Quick Search" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;">
        </form>
        <hr/>
        <h3>Gestion Site</h3>
        <ul class="toggle">
            <li class="icn_new_article"><a href="creationSite.php">Création de site</a></li>
            <li class="icn_edit_article"><a href="#dialog" name="modal">Modification de site</a></li>               
        </ul>
        <h3>Utilisateurs</h3>
        <ul class="toggle">
            <li class="icn_add_user"><a href="ajouterUser.php">Ajout d'un utilisateur</a></li>
            <li class="icn_view_users"><a href="users.php">Liste des utilisateurs</a></li>
        </ul>
        <h3>Admin</h3>
        <ul class="toggle">
            <li class="icn_settings"><a href="#">Options</a></li>
            <li class="icn_security"><a href="#">Security</a></li>
            <li class="icn_jump_back"><a href="#">Logout</a></li>
        </ul>

        <footer>
        </footer>
    </aside><!-- end of sidebar -->

    <section>
        <article id="articleAjout" class="module width_3_quarter">
            <header><h3 class="tabs_involved">Ajout d'un utilisateur</h3>
            </header>
            <div class="tab_container">
                <div class="content">
                    <form class="form" id="formCreation">
                        <div class="module_content">
                            <fieldset>
                                <label for="nom">Nom</label>
                                <input type="text" name="nom" id="nom" required="required">
                            </fieldset>
                            <fieldset>
                                <label for="prenom">Pr&eacute;nom</label>
                                <input type="text" id="prenom" name="prenom" value="" required="required">
                            </fieldset>
                            <fieldset>
                                <label for="login">Nom d'utilisateur</label>
                                <input type="text" id="login" name="login" value="" required="required">
                            </fieldset>
                            <fieldset>
                                <label for="password">Mot de passe</label>
                                <input type="password" id="password" name="password" required="required">
                            </fieldset> 
                            <fieldset>
                                <label for="passverif">Confimation du mot de passe</label>
                                <input id="passverif" type="password" name="passverif" required="required">
                            </fieldset> 
                            <fieldset>
                                <label for="lecture">Droit de lecture</label>
                                <input type="checkbox" id="lecture" name="lecture" value="">
                            </fieldset>  
                            <fieldset>
                                <label for="ecriture">Droit d'écriture</label>
                                <input type="checkbox" id="ecriture" name="ecriture" value="">
                            </fieldset>
                        </div>
                        <footer>
                            <div class="submit_link">
                                <input type="submit" value="Ajouter" class="alt_btn">
                            </div>
                        </footer>
                    </form>
                </div>
            </div>
        </article>
    </section>

    <div id="boxes">

        <div id="dialog" class="window" id="dialog">
            <article class="module width_full">
                <header><h3>Liste des sites</h3></header>
                <div class="module_content">
                    <div>
                        <p>Choisissez un site</p>
                        <ul id="lienSite"></ul>
                    </div>
                </div>
                <footer>
                    <div class="submit_link">
                        <input type="submit" value="Annuler" class="close">
                        <a href="creationSite.php"><input type="submit" value="Nouveau site" class="alt_btn"></a>
                    </div>
                </footer>
            </article>
        </div>

        <!-- Masque pour masquer l'ensemble de l'écran -->
        <div id="mask"></div>
</body>       